<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <script>
    // 1. includes 判断某个字符是否在字符串里
    var str = 'abcdefg';
    console.log( str.includes("deg"));

    // 正则 git sql

    //2.repeat : 可以重复某个字符;
    var str = "*";
    console.log(str.repeat(5));

    var str = "fadawd234我的23挖到无2324吊袜带无"
    var res = str.replace(/\d+/g , function(arg){
        console.log(arg);
        return "*".repeat(arg.length);
    })
        console.log(res);

    // 3.padStart(),padEnd() : 根据给的位数补全字符串
    // var str = "abc"
    // var res = str.padStart(5,"$")
    // console.log(res);
    // var str = "abc";
    // var res = str.padEnd(6,"$");
    // console.log(res);

    //4.startsWith : 判断某个字符串 是以某某作为开头
    // endsWith ;
    var str = "hello world";
    console.log(str.startsWith("hello"));
    console.log(str.endsWith("world"));



   </script> 
</body>
</html>